import axios from 'axios'

axios.defaults.baseURL = 'http://coin.chainvictory.com/api'

// 请求拦截器
axios.interceptors.request.use(config => {
  return config;
}, error => {
  Promise.reject(error)
});

// 响应拦截器

axios.interceptors.response.use(
  response => {
    switch (response.data.code) {
      case 100:
        return response.data.data
    }
  },
  error => {
    return Promise.reject(error)
  }
)

export default axios;
